//设置函数实现数据刷新调用
function get_pro_top_data() {
	$.ajax({
		url: "/pro_top",
        success: function(data) {
            option.yAxis.data=data.data;
            option.series[0].data=data.value;
            province_top.setOption(option);
		},
		error: function(xhr, type, errorThrown) {
        }
	})
}

function get_book_top_data() {
    $.ajax({
        url:"/book_top",
        success: function(data) {
			option1.xAxis.data=data.data;
            option1.series[0].data=data.value;
            booktop.setOption(option1);
		},
		error: function(xhr, type, errorThrown) {
		}
    })
}

function get_press_top_data() {
    $.ajax({
        url:"/presstop",
        success: function(data) {
			option2.xAxis.data=data.data;
            option2.series[0].data=data.value;
            press.setOption(option2);
		},
		error: function(xhr, type, errorThrown) {
		}
    })
}


function get_map_data() {
    $.ajax({
        url:"/map1",
        success: function(data) {
			map1_option.series[0].data=data.data;
            map1.setOption(map1_option)
		},
		error: function(xhr, type, errorThrown) {
		}
    })
}

function get_book_type_data() {
    $.ajax({
        url: "/book_type",
        success: function (data) {
            book_type_option.series[0].data=data.data;
            book_type.setOption(book_type_option);
        }
    })
}

function get_pay_data() {
    $.ajax({
        url: "/pay",
        success: function (data) {
            pay_option.series[0].data=data.data;
            pay.setOption(pay_option);
        }
    })
}


function get_speed_data() {
    $.ajax({
        url: "/speed",
        success: function (data) {
            speed_option.series[0].data=[data.data];
            speed.setOption(speed_option);
        }
    })
}



function get_c1_data() {
	$.ajax({
		url: "/c1",
		success: function(data) {
			$(".num h1").eq(0).html(data.total_price);
			$(".num h1").eq(1).html(data.order_num);
			$(".num h1").eq(2).html(data.recipient);
		},
		error: function(xhr, type, errorThrown) {

		}
	})
}
//function get_map_data() {
//	$.ajax({
//		url: "/map1",
//        success: function(data) {
//            option3.series[0].data=data.data;
//            map1.setOption(option3)
//		},
//		error: function(xhr, type, errorThrown) {
//        }
//	})
//}

//执行函数
get_pro_top_data();
get_book_top_data();
get_press_top_data();

get_c1_data();
get_map_data();

get_book_type_data();
get_speed_data();
get_pay_data()
//get_map_data();

//设置刷新时间间隔
setInterval(get_pro_top_data,1000);
setInterval(get_book_top_data,1000);
setInterval(get_press_top_data,1000);

setInterval(get_c1_data,1000);
setInterval(get_map_data,1000);

setInterval(get_book_type_data,1000);
setInterval(get_speed_data,1000);
setInterval(get_pay_data,1000);
//setInterval(get_map_data,1000);